<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <title>志愿帮助系统</title>
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="__PUBLIC__/js/layui/css/layui.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="panel panel-primary">
        <div class="panel-heading">
            修改资料
        </div>
        <div class="panel-body" id="description">
            <form action="" class="form-horizontal">
                <div class="line line-dashed line-lg pull-in"></div>
                <div class="form-group">
                    <div class="input-group">
                        <span class="input-group-addon"><i class="fa fa-paperclip"></i></span>
                        <textarea class="form-control" v-model="content" cols="15" rows="4"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div align="center">
                        <button type="button" v-on:click="submit" class="btn btn-primary">确定修改</button>
                    </div>
                </div>
                <div class="line line-dashed line-lg pull-in"></div>
            </form>
        </div>
    </div>
</div>
<script src="__PUBLIC__/js/layui/layui.all.js"></script>
<script src="__PUBLIC__/js/vue.js"></script>
<script src="__PUBLIC__/js/vue-resource.js"></script>
<script>
    var description=new Vue({
        el:"#description",
        data:{
           content:"",
        },
        methods:{
            submit:function () {
                this.$http.post('editDescriptionJson',{content:this.content}).then(
                    (data)=>
                    {
                        if (data.body.result==="success")
                        {
                            layer.msg("修改成功");
                        }
                        else
                        {
                            layer.msg(data.body.msg);
                        }
                    },
                    (err)=>
                    {
                        layer.msg("修改失败");
                    }
                )
            }
        },
        created:function () {
            this.$http.post('getDescriptionJson',{content:this.content}).then(
                (data)=>
                {
                    this.content=data.body.description;
                },
                (err)=>
                {
                    layer.msg("获取失败");
                }
            )
        }
    });
</script>
</body>